home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / slib / tk / demos / mkLabel.tcl < prev    next >
Text File  |  1994-09-20  |  1KB  |  35 lines

  1. # mkLabel w
  2. #
  3. # Create a top-level window that displays a bunch of labels.
  4. #
  5. # Arguments:
  6. #    w -    Name to use for new top-level window.
  7.  
  8. proc mkLabel {{w .l1}} {
  9.     global tk_library
  10.     catch {destroy $w}
  11.     toplevel $w
  12.     dpos $w
  13.     wm title $w "Label Demonstration"
  14.     wm iconname $w "Labels"
  15.     message $w.msg -font -Adobe-times-medium-r-normal--*-180* -aspect 300 \
  16.         -text "Five labels are displayed below: three textual ones on the left, and a bitmap label and a text label on the right.  Labels are pretty boring because you can't do anything with them.  Click the \"OK\" button when you've seen enough."
  17.     frame $w.left
  18.     frame $w.right
  19.     button $w.ok -text OK -command "destroy $w"
  20.     pack $w.msg -side top
  21.     pack $w.ok -side bottom -fill x
  22.     pack $w.left $w.right -side left -expand yes -padx 10 -pady 10 -fill both
  23.  
  24.     label $w.left.l1 -text "First label"
  25.     label $w.left.l2 -text "Second label, raised just for fun" -relief raised
  26.     label $w.left.l3 -text "Third label, sunken" -relief sunken
  27.     pack $w.left.l1 $w.left.l2 $w.left.l3 \
  28.         -side top -expand yes -pady 2 -anchor w
  29.  
  30.     label $w.right.bitmap -bitmap @$tk_library/demos/bitmaps/face \
  31.         -borderwidth 2 -relief sunken
  32.     label $w.right.caption -text "Tcl/Tk Proprietor"
  33.     pack $w.right.bitmap $w.right.caption -side top
  34. }
  35.